<template>
  <!--表单子控件的基础属性维护-->
  <nf-form
    v-form-drag="baseFormProps"
    :model="state.base1"
    v-bind="baseFormProps"
  >
  </nf-form>
  <hr>
  <nf-form
    v-form-drag="baseForm2Props"
    :model="state.base2"
    v-bind="baseForm2Props"
  >
  </nf-form>
  <hr>
</template>

<script>
/* eslint-disable vue/no-mutating-props */
/* eslint-disable vue/no-setup-props-destructure */
  import { reactive, defineComponent } from 'vue'
  // import { createColDefValue } from './miniMeta'
  import { getItemState } from './state-item'

  // 基础属性表单的 meta
  import item_base from './json/item-base.json'
  import item_base2 from './json/item-base2.json'

  // 基础属性的默认值
  // const baseDefaultValue = createColDefValue(item_base.itemMeta)

  export default defineComponent({
    name: 'nf-meta-help-item-base',
    inheritAttrs: false,
    components: {
    },
    props: {
      itemMeta: [Object]
    },
    setup(props) {
      // 基础属性的表单需要的 meta，创建表单用
      const baseFormProps = reactive(item_base)
      const baseForm2Props = reactive(item_base2)

      // 内部 model
      const state = getItemState()
      
      return {
        state,
        baseFormProps,
        baseForm2Props
      }
    }
  })

</script>